//
//  LCFeedbackVC.m
//  LongChain
//
//  Created by FengZi on 2018/4/1.
//  Copyright © 2018年 FengZi. All rights reserved.
//

#import "LCFeedbackListVC.h"
#import "LCFeedBackCell.h"

#import "LCQuestionVC.h"

@interface LCFeedbackListVC ()<UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>

@property (nonatomic, strong) NSArray *feedBackQuestions;


@end

@implementation LCFeedbackListVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.feedBackQuestions = @[
                   @"1.APP提示连不上设备怎么办？",
                   @"2.硬盘的部分内容在朗链云中看不到了？",
                   @"3.更换了手机号如何更换我的朗链云账号？",
                   @"4.一个账号可以绑定几台朗链云？",
                   @"5.上传的文件数据能否够安全、够隐私、无泄漏？",
                   @"6.如何通过HDMI播放朗链云中的内容？",
                   @"7.为什么在线时长、硬盘空间一样、同样接入百兆带宽，但挖矿的数量不一样？",
                   ];

}


- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {
    if ([kind isEqualToString:UICollectionElementKindSectionHeader]) {
        UICollectionReusableView *header = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"desHeader" forIndexPath:indexPath];
        return header;
    }
    return nil;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    NSInteger row = [indexPath row];
    LCFeedBackCell *feedBackCell = [collectionView dequeueReusableCellWithReuseIdentifier:@"questionsListCell" forIndexPath:indexPath];
    if (_feedBackQuestions.count > row) {
        [feedBackCell lc_updateFeedBackListCellWithParameter:_feedBackQuestions[row]];
    }
    return feedBackCell;
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return _feedBackQuestions.count;
}

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section {
    return CGSizeMake(SWidth, 60);
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    return CGSizeMake(SWidth, 60);
}

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    LCLog(@"点击反馈列表")
    
    NSInteger row = [indexPath row];
    
    LCQuestionVC *question = [[LCQuestionVC alloc]init];
    question.index = row;
    question.titleStr = self.feedBackQuestions[row];
    [self.navigationController pushViewController:question animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
